package com.u.finance.loans.service;

import com.u.finance.loans.entity.Loans;
import com.baomidou.mybatisplus.extension.service.IService;
import com.u.finance.loans.model.LoanApplyForm;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Alex Wu
 * @since 2025-03-28
 */
public interface ILoansService extends IService<Loans> {

    Long getQuotaLimit(String userId);

    Boolean applyLoan(LoanApplyForm loanApplyForm);

    @Transactional(rollbackFor = Exception.class)
    void saveInTransaction(Loans beans);

    @GlobalTransactional
    void payOut(Long id);

    Boolean create(Loans loans);
}
